import { request } from "./request";

//banner
export function getHomeBanner() {
  return request({
    method: "GET",
    url: "/banner?type=0&t=" + Date.now(),
  });
}

//推荐歌单
export function getHotSongList() {
  return request({
    method: "GET",
    url: "/personalized?limit=18&t=" + Date.now(),
  });
}

//全部新碟
export function getNewDisc() {
  return request({
    method: "GET",
    url: "/album/new?limit=16&t=" + Date.now(),
  });
}

//歌手分类列表
export function getSonger(offset, limit, initialId, typeId, areaId) {
  return request({
    method: "GET",
    url: "/artist/list?offset=" + offset + "&limit=" + limit + "&type=" + typeId + "&area=" + areaId + "&initial=" + initialId + "&t=" + Date.now(),
  });
}

//热搜列表(详细)
export function getHotList() {
  return request({
    method: "GET",
    url: "/search/hot/detail&t=" + Date.now(),
  });
}

//数字专辑-新碟上架
export function getNewAlbums(offset, limit) {
  return request({
    method: "GET",
    url: "/album/list?limit=" + limit + "&offset=" + offset + "&t=" + Date.now(),
  });
}

//数字专辑&数字单曲-榜单
export function getAlbumBoard(type, albumType) {
  return request({
    method: "GET",
    url: "/album/songsaleboard?type=" + type + "&albumType=" + albumType + "&t=" + Date.now(),
  });
}

//数字专辑-语种风格馆
export function getAlbumArea(area) {
  return request({
    method: "GET",
    url: "/album/list/style?area=" + area + "&t=" + Date.now(),
  });
}

//推荐MV
export function getRecommentMV() {
  return request({
    method: "GET",
    url: "/personalized/mv?t=" + Date.now(),
  });
}

//全部MV
export function getAllMVs(limit, offset, area, type, order) {
  return request({
    method: "GET",
    url: "/mv/all?limit=" + limit + "&offset=" + offset + "&area=" + area + "&type=" + type + "&order=" + order + "&t=" + Date.now(),
  });
}

//歌单分类
export function getSongListClassify() {
  return request({
    method: "GET",
    url: "/playlist/catlist?t=" + Date.now(),
  });
}

//歌单 ( 网友精选碟 )
export function getSongList(limit, offset, cat) {
  return request({
    method: "GET",
    url: "/top/playlist?limit=" + limit + "&offset=" + offset + "&cat=" + cat + "&t=" + Date.now(),
  });
}

//所有榜单
export function getAllRankingListId() {
  return request({
    method: "GET",
    url: "/toplist?t=" + Date.now(),
  });
}

//获取歌单详情
export function getSongListDetails(songListId, cookie) {
  return request({
    method: "GET",
    url: "/playlist/detail?id=" + songListId + "&cookie=" + cookie + "&t=" + Date.now(),
  });
}

//获取mv播放地址
export function getMVUrl(mvId) {
  return request({
    method: "GET",
    url: "/mv/url?id=" + mvId + "&t=" + Date.now(),
  });
}

//获取mv数据
export function getMVData(mvId) {
  return request({
    method: "GET",
    url: "/mv/detail?mvid=" + mvId + "&t=" + Date.now(),
  });
}

//获取 mv 点赞转发评论数数据
export function getMVDataInfo(mvId) {
  return request({
    method: "GET",
    url: "/mv/detail/info?mvid=" + mvId + "&t=" + Date.now(),
  });
}

//相似MV
export function getSimiMV(mvId) {
  return request({
    method: "GET",
    url: "/simi/mv?mvid=" + mvId + "&t=" + Date.now(),
  });
}

//MV评论
export function getMVComments(mvId, offset) {
  return request({
    method: "GET",
    url: "/comment/mv?id=" + mvId + "&limit=20" + "&offset=" + offset + "&t=" + Date.now(),
  });
}

//获取歌手单曲
export function getSongerSong(id) {
  return request({
    method: "GET",
    url: "/artists?id=" + id + "&t=" + Date.now(),
  });
}

//获取歌手MV
export function getSongerMV(id, offset) {
  return request({
    method: "GET",
    url: "/artist/mv?id=" + id + "&limit=12" + "&offset=" + offset + "&t=" + Date.now(),
  });
}

//获取歌手专辑
export function getSongerAlbum(id, offset) {
  return request({
    method: "GET",
    url: "/artist/album?id=" + id + "&limit=12" + "&offset=" + offset + "&t=" + Date.now(),
  });
}

//获取歌手描述
export function getSongerDesc(id) {
  return request({
    method: "GET",
    url: "/artist/desc?id=" + id + "&t=" + Date.now(),
  });
}

//获取歌手详情
export function getSongerDetails(id) {
  return request({
    method: "GET",
    url: "/artist/detail?id=" + id + "&t=" + Date.now(),
  });
}

//热门歌手
export function getHotSonger(offset) {
  return request({
    method: "GET",
    url: "/top/artists?limit=20" + "&offset=" + offset + "&t=" + Date.now(),
  });
}

//获取相似歌手
export function getSimiSonger(id) {
  return request({
    method: "GET",
    url: "/simi/artist?id=" + id + "&t=" + Date.now(),
  });
}

//获取用户详情
export function getUserDetails(id) {
  return request({
    method: "GET",
    url: "/user/detail?uid=" + id + "&t=" + Date.now(),
  });
}

//获取用户歌单
export function getUserSongList(id, limit) {
  return request({
    method: "GET",
    url: "/user/playlist?uid=" + id + "&limit=" + limit + "&t=" + Date.now(),
  });
}

//默认用户登陆
export function loginDefaultUser(phone, password) {
  return request({
    method: "GET",
    url: "/login/cellphone?phone=" + phone + "&password=" + password + "&t=" + Date.now(),
    withCredentials: true,
  });
}

//获取歌单所有歌曲
export function getSongListAllSong(id, offset, cookie) {
  return request({
    method: "GET",
    url: "/playlist/track/all?id=" + id + "&limit=10&offset=" + offset + "&cookie=" + cookie + "&t=" + Date.now(),
  });
}

//歌单评论
export function getSongListComments(id, offset, cookie) {
  return request({
    method: "GET",
    url: "/comment/playlist?id=" + id + "&limit=20&offset=" + offset + "&cookie=" + cookie + "&t=" + Date.now(),
  });
}

//获取专辑内容
export function getAlbumDetails(id) {
  return request({
    method: "GET",
    url: "/album?id=" + id + "&t=" + Date.now(),
  });
}

//专辑评论
export function getAlbumComment(id, offset) {
  return request({
    method: "GET",
    url: "/comment/album?id=" + id + "&limit=20&offset=" + offset + "&t=" + Date.now(),
  });
}

//获取歌曲详情
export function getSongDetails(songId) {
  return request({
    method: "GET",
    url: "/song/detail?ids=" + songId + "&t=" + Date.now(),
  });
}

//获取歌词
export function getSongLyric(songId) {
  return request({
    method: "GET",
    url: "/lyric?id=" + songId + "&t=" + Date.now(),
  });
}

//歌曲评论
export function getSongComment(songId, offset) {
  return request({
    method: "GET",
    url: "/comment/music?id=" + songId + "&limit=20&offset=" + offset + "&t=" + Date.now(),
  });
}

//获取相似音乐
export function getSimiSong(songId) {
  return request({
    method: "GET",
    url: "/simi/song?id=" + songId + "&t=" + Date.now(),
  });
}
